Method and terminal device for matching photographed objects and preset text information

ABSTRACT

A photographing method and a terminal device are disclosed. The method includes: receiving, by a terminal device, a first operation; starting, by the terminal device, a camera in response to the first operation; displaying, by the terminal device, a first preview screen including a first preview image, where the first preview image includes at least one photographed object, and the at least one photographed object in the first preview image matches preset first text information; and outputting, by the terminal device, first prompt information based on the first preview image and the first text information, where the first prompt information is used to indicate a missing or redundant photographed object in the first preview image. Indicated by the prompt information, a user can move a position or an angle of the terminal device.

CROSS-REFERENCE TO RELATED APPLICATIONS

This application is a continuation of U.S. patent application Ser. No.17/047,653, filed on Oct. 14, 2020, which is a national stageapplication of International Application No. PCT/CN2019/084704, filed onApr. 28, 2019. The International Application claims priority toInternational Application No. PCT/CN2018/085184, filed on Apr. 28, 2018.All of the aforementioned patent applications are hereby incorporated byreference in their entireties.

TECHNICAL FIELD

This application relates to the field of image photographingtechnologies, and in particular, to a photographing method and aterminal device.

BACKGROUND

As communications technologies develop, various functions of a terminaldevice are continuously improved. A photographing function of theterminal device has become one of functions that are frequently used bya user.

For example, during traveling, the user is desirous of photographing acomparatively high-quality image of a beautiful landscape for goodmemories. However, most users are not professional photographers orphotography enthusiasts. They do not grasp a photographing technique,and do not know how to photograph a favorable photo. As a result, aphotographed photo is poor and dull, which affects user's mood andreduces user experience.

SUMMARY

Embodiments of this application provide a photographing method and aterminal device, to instruct a user to photograph a comparativelyhigh-quality image, and improve user experience.

According to a first aspect, an embodiment of the present inventionprovides a photographing method, and the method is applicable to aterminal device having an image photographing function. The methodincludes: receiving, by the terminal device, a first operation;starting, by the terminal device, a camera in response to the firstoperation; displaying, by the terminal device, a first preview screenincluding a first preview image, where the first preview image includesat least one photographed object, and the at least one photographedobject in the first preview image matches preset first text information;and outputting, by the terminal device, first prompt information basedon the first preview image and the first text information, where thefirst prompt information is used to indicate a missing or redundantphotographed object in the first preview image.

In this embodiment of this application, the preview image includes theat least one photographed object, and the terminal device outputs theprompt information based on the preview image and the text informationthat matches the preview image, to indicate the missing or redundantphotographed object in the preview image to a user. Indicated by theprompt information, the user can move a position or an angle of theterminal device, so that the missing photographed object is photographedas much as possible, and the redundant photographed object is notphotographed, to achieve a better photographing effect. This manner caninstruct the user to photograph a comparatively high-quality image, tohelp improve user experience.

In a possible design, after the terminal device outputs the first promptinformation, the terminal device receives a second operation; inresponse to the second operation, the terminal device displays a secondpreview screen including a second preview image, where the secondpreview image is different from the first preview image, the secondpreview image includes at least one photographed object, and the atleast one photographed object in the second preview image matches presetsecond text information; and the terminal device outputs second promptinformation based on the second preview image and the second textinformation, where the second prompt information is different from thefirst prompt information, and the second prompt information is used toindicate a missing or redundant photographed object in the secondpreview image.

In this embodiment of this application, when the position of theterminal device is moved or a focal length is changed, the preview imagedynamically changes. When the preview image changes, the promptinformation output by the terminal device also changes. In other words,the terminal device may indicate in real time, the missing or redundantphotographed object in the current preview image to the user. In thismanner, the terminal device can instruct the user to move the positionor the angle of the terminal device, so that the missing photographedobject is photographed, and the redundant photographed object is notphotographed, to achieve the better photographing effect. This mannercan instruct the user to photograph the comparatively high-qualityimage, to help improve user experience.

In a possible design, a preview image includes M photographed objects,the preview image is the first preview image or the second previewimage, and if N photographed objects in the M photographed objects matchpreset text information, the redundant photographed object is remaining(M−N) photographed objects obtained after the N photographed objects areremoved from the M photographed objects, or if text information thatmatches the M photographed objects includes a keyword corresponding toanother photographed object other than the M photographed objects, theanother photographed object is the missing photographed object, whereN≥1, and N<M. In other words, the redundant photographed object in thefirst preview image is a photographed object included in the firstpreview image but not included in the first text information; and themissing photographed object in the first preview image is a photographedobject included in the first text information but not included in thefirst preview image; or the redundant photographed object in the secondpreview image is a photographed object included in the second previewimage but not included in the second text information; and the missingphotographed object in the second preview image is a photographed objectincluded in the second text information but not included in the secondpreview image.

In this embodiment of this application, the terminal device matchesappropriate text information based on the M photographed objects in thepreview image. If the N photographed objects in the M photographedobjects match the text information, the remaining (M−N) photographedobjects are the redundant photographed object. When the text informationis matched based on the M photographed objects, if the matched textinformation further includes the another object other than the Mphotographed objects, the another object is the missing photographedobject. In this manner, the terminal device can instruct the user tomove the position or the angle of the terminal device, so that themissing photographed object is photographed, and the redundantphotographed object is not photographed, to achieve the betterphotographing effect. This manner can instruct the user to photographthe comparatively high-quality image, to help improve user experience.

In a possible design, the first prompt information is displayed on thefirst preview screen; and the second prompt information is displayed onthe second preview screen. In this embodiment of this application, theprompt information may be displayed on the preview screen, to helpinstruct the user. Certainly, the prompt information may also be voiceinformation. In other words, the user is instructed by using a voice.

In a possible design, the terminal device further outputs matched firsttext information based on the first preview image, and the first textinformation is displayed on the first preview screen. In this embodimentof this application, after the text information is matched based on thephotographed object in the preview image, the terminal device maydisplay the text information, to help the user view the textinformation.

In a possible design, the terminal device further outputs matched secondtext information based on the second preview image, and the second textinformation is displayed on the second preview screen. In thisembodiment of this application, when the position of the terminal deviceis moved or the focal length is changed, the preview image changes.Therefore, the matched text information also changes. Therefore, whenthe preview image dynamically changes, the text information displayed onthe terminal device also dynamically changes.

In a possible design, the first text information includes at least onepiece of text information; or the second text information includes atleast one piece of text information. In this embodiment of thisapplication, there may be at least one type of the text informationmatched by the terminal device based on the photographed object in thepreview image. If there are a plurality of types of text information,the terminal device may also display the plurality of types of textinformation on the preview screen.

In a possible design, the terminal device further outputs first matchingdegree information based on the first preview image, where the firstmatching degree information is used to indicate a matching degreebetween the first text information and the first preview image, and thefirst matching degree information is displayed on the first previewscreen. In this embodiment of this application, after the textinformation is matched, the terminal device may further display thematching degree information. The user learns of the matching degreebetween the text information and the preview image by using the matchingdegree information.

In a possible design, the terminal device further outputs secondmatching degree information based on the second preview image, where thesecond matching degree information is used to indicate a matching degreebetween the second text information and the second preview image, andthe second matching degree information is displayed on the secondpreview screen. In this embodiment of this application, when theposition of the terminal device is moved or the focal length is changed,the preview image changes, and the matched text information alsochanges. Therefore, the matching degree information between the textinformation and the preview image also changes. Therefore, when thepreview image dynamically changes, the matching degree informationoutput by the terminal device also dynamically changes. Therefore, theuser may search for a better photographing range or angle by using thematching degree information. For example, when the user finds aphotographing angle where a matching degree displayed on the previewscreen is comparatively high, the user can determine that thephotographing angle is comparatively good. This manner can instruct theuser to photograph the comparatively high-quality image, to help improveuser experience.

In a possible design, the terminal device further outputs firstdirection indication information based on the first preview image, wherethe first direction indication information is used to instruct the userto move the terminal device in an indicated first direction, and thefirst direction indication information is displayed on the first previewscreen. In this embodiment of this application, the terminal device mayfurther display the direction indication information, and instruct theuser to move the terminal device in the direction by using the directionindication information. For example, if the terminal device determinesthat a bird is missing in a current preview image, the terminal devicemay display an upward arrow, to instruct the user to move the terminaldevice upward. This manner can instruct the user to photograph thecomparatively high-quality image, to help improve user experience.

In a possible design, the terminal device further outputs seconddirection indication information based on the second preview image,where the second direction indication information is used to instructthe user to move the terminal device in an indicated second direction,and the second direction indication information is displayed on thesecond preview screen. In this embodiment of this application, when theposition of the terminal device is moved or the focal length is changed,the preview image changes, and the matched text information alsochanges. Therefore, the direction indication information also changes.Therefore, when the preview image dynamically changes, the directionindication information displayed on the terminal device also dynamicallychanges, to instruct the user to move the terminal device in a specificdirection. This manner can instruct the user to photograph thecomparatively high-quality image, to help improve user experience.

In a possible design, a second control is displayed in the first previewimage, and the second control is configured to trigger displaying a typeof text information; the terminal device displays a first list inresponse to a user's operation of triggering the second control, wherethe first list includes at least one type of the text information; andthe terminal device displays the first text information in response to auser's operation of selecting a first type, where a type of the firsttext information is the first type. In this embodiment of thisapplication, the user may select the type of the text information. Whenthe user selects a type, the terminal device may display textinformation of this type. In this manner, the user can select the typeof the text information based on a user's preference, to help improveuser experience.

In a possible design, the first preview screen includes a firstphotographing control, and the terminal device obtains two firstphotographed images in response to an operation used to trigger thefirst photographing control, where one of the two first photographedimages includes the first text information, and the other firstphotographed image does not include the first text information. In thisembodiment of this application, if the user triggers the photographingcontrol, the terminal device may obtain the two images: one image doesnot include the text information, and the other image includes the textinformation.

In a possible design, the second preview screen includes a secondphotographing control, and the terminal device obtains two secondphotographed images in response to an operation used to trigger thesecond photographing control, where one of the two second photographedimages includes the second text information, and the other secondphotographed image does not include the second text information. In thisembodiment of this application, when the position of the terminal deviceis moved or the focal length is changed, the preview image changes.Therefore, the matched text information also changes. Therefore, at aposition, if triggering the photographing control, the user obtains thetwo images: one includes the text information, and the other does notinclude the text information.

In a possible design, a preview image includes M photographed objects,and the preview image is the first preview image or the second previewimage; when M is 1, and when the terminal device matches textinformation based on N photographed objects in the M photographedobjects, the terminal device extracts characteristic information of thephotographed object, the terminal device determines, based on a mappingrelationship between characteristic information and a keyword, a keywordcorresponding to the extracted characteristic information; and theterminal device determines text information including the keyword. Inthis embodiment of this application, when the preview image includes onephotographed object, the text information matched by the terminal deviceincludes the keyword corresponding to the photographed object.

In a possible design, a preview image includes M photographed objects,and the preview image is the first preview image or the second previewimage; when M is greater than or equal to 2, and when the terminaldevice matches text information based on N photographed objects in the Mphotographed objects, the terminal device determines the N photographedobjects whose weights are greater than a preset weight in the Mphotographed objects, where the weight is used to indicate a proportionof a display area of one photographed object to a display area of anentire preview image; the terminal device extracts characteristicinformation from each of the N photographed objects to obtain N piecesof characteristic information in total; the terminal device determines,based on a mapping relationship between characteristic information and akeyword, N keywords corresponding to the extracted N pieces ofcharacteristic information; and the terminal device determines textinformation including the N keywords. In this embodiment of thisapplication, when the preview image includes a plurality of photographedobjects, the terminal device selects the N photographed objects from theplurality of photographed objects based on a weight of each photographedobject, determines the N keywords, and then searches for the textinformation including the N keywords.

In a possible design, when the terminal device matches the textinformation based on the N photographed objects in the M photographedobjects, the terminal device determines at least two types of textinformation based on the N photographed objects in the M photographedobjects, the terminal device detects current timeinformation/geographical location information; and the terminal deviceselects one type of text information from the at least two types of textinformation based on the time information/geographical locationinformation; or the terminal device selects one type of text informationfrom the at least two types of text information according to a prioritypolicy, where the priority policy includes a priority sequence betweenthe at least two types of text information. In this embodiment of thisapplication, when the terminal device matches the plurality of types oftext information based on the photographed object in the preview image,the terminal device may select one type of text information from theplurality of types of text information according to the priority policyor based on the time information/geographic location information.

In a possible design, if the user selects other text information otherthan the matched text information, the terminal device determineswhether a quantity of times that the user selects the other textinformation exceeds a preset quantity of times; when the quantity oftimes that the user selects the other text information exceeds thepreset quantity of times, the terminal device sets a first prioritylevel of the other text information to a second priority level, wherethe second priority level is higher than the first priority level; andthe terminal device updates the priority policy based on the secondpriority level of the other text information. In this embodiment of thisapplication, text information displayed on the terminal device may notbe text information preferred by the user. Therefore, the user mayselect the other text information, and the terminal device may recordthe quantity of times that the user selects the other text information.When the user selects the other text information for a comparativelylarge quantity of times, the priority level of the other textinformation is improved. During next photographing, the text informationof this type is preferably recommended. In this manner, the terminaldevice may record a use habit of the user, and match text informationthat conforms to the use habit of the user.

In a possible design, if the text information includes a poem, beforethe terminal device outputs the first prompt information based on thefirst preview image, the terminal device further responds to a user'sthird operation. The terminal device displays, on the first previewscreen, a setting screen for setting a poem mode, where the settingscreen includes an icon of the poem mode and a first control. Theterminal device enables the poem mode in response to a user's operationof triggering the first control, where the poem mode is an appropriatepoem mode matched by the terminal device based on a photographed objectin the first preview image. In this embodiment of this application,after the terminal device starts the camera, the user may enable thedevice screen for setting the poem mode, and enable the poem mode bytriggering the control corresponding to the poem mode. In this manner,the user may select to enable or disable the poem mode, to help improveuser experience.

In a possible design, the first preview screen includes a third controland a fourth control, the third control is configured to triggerupdating of the first text information, and the fourth control isconfigured to trigger displaying of used text information. In thisembodiment of this application, if unsatisfied with the text informationmatched by the terminal device, the user may trigger a control to changethe text information into the other text information, and the user mayalso trigger another control to view the used text information.

In a possible design, the text information may include a poem, a song, aproverb, a famous quote, or an internet buzzword. In this embodiment ofthis application, the foregoing several types are merely examples, andthe text information may further include other types of information.This is not limited in this embodiment of this application.

According to a second aspect, an embodiment of the present inventionprovides a photographing method, and the method is applicable to aterminal device having an image photographing function. The methodincludes: receiving, by the terminal device, a first operation;starting, by the terminal device, a camera in response to the firstoperation; displaying, by the terminal device, a first preview screenincluding a first preview image, where the first preview image includesat least one photographed object; and displaying, by the terminaldevice, a first identifier of first music on the first preview screen,where the first music is music matched by the terminal device based onthe at least one photographed object in the first preview image, and thefirst identifier is text or an icon. In this embodiment of thisapplication, the terminal device matches the appropriate music based onthe photographed object in the preview image, and then displays theidentifier of the matched music. In this manner, in a process ofphotographing an image, the terminal device can match the appropriatemusic, to improve user experience.

In a possible design, after the terminal device displays the firstidentifier of the first music on the first preview screen, the terminaldevice receives a second operation; in response to the second operation,the terminal displays a second preview screen including a second previewimage, where the second preview image is different from the firstpreview image, and the second preview image includes at least onephotographed object; and the terminal device displays a secondidentifier of second music on the second preview screen, where thesecond music is different from the first music, the second music ismusic matched by the terminal device based on the at least onephotographed object in the second preview image, and the secondidentifier is text or an icon. In this embodiment of this application,when a position of the terminal device is moved or a focal length ischanged, the preview image changes. Therefore, the matched music alsochanges. Therefore, when the preview image dynamically changes, theterminal device matches the appropriate music in real time.

In a possible design, the first preview screen includes a firstphotographing control, and the terminal device obtains a firstphotographed image in response to an operation used to trigger the firstphotographing control, where the first photographed image is an imageobtained by the terminal device by synthesizing the first music and thefirst preview image. In this embodiment of this application, theterminal device may match the appropriate music based on the previewimage, and may generate an audio image obtained by synthesizing thepreview image and the matched music. In this manner, quality of thephotographed image is improved, and interest in an image photographingprocess is improved to some extent.

In a possible design, the second preview screen includes a secondphotographing control, and the terminal device obtains a secondphotographed image in response to an operation used to trigger thesecond photographing control, where the second photographed image is animage obtained by the terminal device by synthesizing the second musicand the second preview image. In this embodiment of this application,when the position of the terminal device is moved or the focal length ischanged, the preview image changes. Therefore, the matched music alsochanges. Therefore, when the preview image dynamically changes, theterminal device matches the appropriate music in real time. When theterminal device is moved to a position, if the user triggers thephotographing control, the terminal device may match the appropriatemusic based on the preview image, and may generate the audio imageobtained by synthesizing the preview image and the matched music. Inthis manner, the quality of the photographed image is improved, and theinterest in the image photographing process is improved to some extent.

In a possible design, before the terminal device displays the firstidentifier of the first music, in response to a user's operation, theterminal device displays, on the first preview screen, a setting screenfor setting a music mode, where the setting screen includes an icon ofthe music mode and a first control; and the terminal enables the musicmode in response to a user's operation of triggering the first control,where the music mode is an appropriate music mode matched by theterminal device based on a photographed object in the first previewimage. In this embodiment of this application, the user may select toenable or disable the music mode based on a user's preference, to helpimprove user experience.

In a possible design, a preview image includes M photographed objects,and the preview image is the first preview image or the second previewimage; when M is 1, and when the terminal device matches music based onthe at least one photographed object in the preview image, the terminaldevice extracts characteristic information of the photographed object;the terminal device determines, based on a mapping relationship betweencharacteristic information and a keyword, a keyword corresponding to theextracted characteristic information; and the terminal device determinesmusic whose lyrics include the keyword or whose name includes thekeyword. In this embodiment of this application, when the preview imageincludes one photographed object, the lyrics or the name of the musicmatched by the terminal device include or includes the keywordcorresponding to the photographed object.

In a possible design, a preview image includes M photographed objects,and the preview image is the first preview image or the second previewimage; when M is greater than or equal to 2, and when the terminaldevice matches the music based on the at least one photographed objectin the preview image, the terminal device determines the N photographedobjects whose weight is greater than a preset weight in the Mphotographed objects, where the weight is used to indicate a proportionof a display area of one photographed object to a display area of anentire preview image; the terminal device extracts characteristicinformation from each of the N photographed objects to obtain N piecesof characteristic information in total; the terminal device determines,based on a mapping relationship between characteristic information and akeyword, N keywords corresponding to the extracted N pieces ofcharacteristic information; and the terminal device determines the musicwhose lyrics include the keyword or whose name includes the keyword. Inthis embodiment of this application, when the preview image includes aplurality of photographed objects, the terminal device selects Nphotographed objects from the plurality of photographed objects based ona weight of each photographed object, determines the N keywords, andthen searches for the music whose lyrics include the N keywords or whosename includes the N keywords.

In a possible design, when the terminal device matches the music basedon the N photographed objects in the M photographed objects, theterminal device determines at least two types of music based on the Nphotographed objects in the M photographed objects, the terminal devicedetects current time information/geographical location information; andthe terminal device selects one type of music from the at least twotypes of music based on the time information/geographical locationinformation; or the terminal device selects one type of music from theat least two types of music according to a priority policy, where thepriority policy includes a priority sequence between the at least twotypes of music. In this embodiment of this application, when theterminal device matches a plurality of pieces of music based on thephotographed object in the preview image, the terminal device may selectone piece of music from the plurality of pieces of music according tothe priority policy or based on the time information/geographic locationinformation.

In a possible design, if the user selects other music other than thematched music, the terminal device determines whether a quantity oftimes that the user selects the other music exceeds a preset quantity oftimes; when the quantity of times that the user selects the other musicexceeds the preset quantity of times, the terminal device sets a firstpriority level of the other music to a second priority level, where thesecond priority level is higher than the first priority level; and theterminal device updates the priority policy based on the second prioritylevel of the other music. In this embodiment of this application, themusic matched by the terminal device may not be music preferred by theuser. Therefore, the user may select the other music, and the terminaldevice may record the quantity of times that the user selects the othermusic. When the user selects the other music for a comparatively largequantity of times, the priority level of the other music is improved.During next photographing, this type of music is preferably recommended.In this manner, the terminal device may record a use habit of the user,and match music that conforms to the use habit of the user.

According to a third aspect, an embodiment of this application providesa terminal device, including a camera, a display screen, a processor,and a memory. The camera is configured to capture a preview image, thedisplay screen is configured to display the preview image, and thememory is configured to store one or more computer programs. When theone or more computer programs stored on the memory are executed by theprocessor, the terminal device is enabled to implement the method in anyone of the first aspect or the possible designs of the first aspect, orwhen the one or more computer programs stored on the memory are executedby the processor, the terminal device is enabled to implement the methodin any one of the second aspect or the possible designs of the secondaspect.

According to a fourth aspect, an embodiment of this application furtherprovides a terminal device. The terminal device includes modules/unitsthat perform the method in any one of the first aspect or the possibledesigns of the first aspect, or the terminal device includesmodules/units that perform the method in any one of the second aspect orthe possible designs of the second aspect. These modules/units may beimplemented by hardware, or may be implemented by hardware by executingcorresponding software.

According to a fifth aspect, an embodiment of this application furtherprovides a computer-readable storage medium. The computer-readablestorage medium includes a computer program. When the computer programruns on a terminal device, the terminal device is enabled to perform themethod in any one of the first aspect or the possible designs of thefirst aspect, or when the computer program runs on a terminal device,the terminal device is enabled to perform the method in any one of thesecond aspect or the possible designs of the second aspect.

According to a sixth aspect, an embodiment of this application furtherprovides a computer program product. When the computer program productruns on a terminal device, the terminal device is enabled to perform themethod in any one of the first aspect or the possible designs of thefirst aspect, or when the computer program product runs on a terminaldevice, the terminal device is enabled to perform the method in any oneof the second aspect or the possible designs of the second aspect.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 is a schematic diagram of a structure of a terminal deviceaccording to an embodiment of the present invention;

FIG. 2 is a flowchart of a photographing method according to anembodiment of the present invention;

FIG. 3A is a schematic diagram of a display state of a display screen ofa mobile phone according to an embodiment of the present invention;

FIG. 3B is a schematic diagram of a display state of a display screen ofa mobile phone according to an embodiment of the present invention;

FIG. 3C is a schematic diagram of a display state of a display screen ofa mobile phone according to an embodiment of the present invention;

FIG. 3D is a schematic diagram of a display state of a display screen ofa mobile phone according to an embodiment of the present invention;

FIG. 3E is a schematic diagram of a display state of a display screen ofa mobile phone according to an embodiment of the present invention;

FIG. 4 is a schematic diagram of a display state of a display screen ofa mobile phone according to an embodiment of the present invention;

FIG. 5 is a schematic diagram of a display state of a display screen ofa mobile phone according to an embodiment of the present invention;

FIG. 6 is a schematic diagram of a display state of a display screen ofa mobile phone according to an embodiment of the present invention;

FIG. 7 is a schematic diagram of a display state of a display screen ofa mobile phone according to an embodiment of the present invention;

FIG. 8 is a schematic diagram of a display state of a display screen ofa mobile phone according to an embodiment of the present invention;

FIG. 9A is a schematic diagram of a display state of a display screen ofa mobile phone according to an embodiment of the present invention;

FIG. 9B is a schematic diagram of a display state of a display screen ofa mobile phone according to an embodiment of the present invention;

FIG. 10 is a flowchart of a photographing method according to anembodiment of the present invention;

FIG. 11 is a schematic diagram of a display state of a display screen ofa mobile phone according to an embodiment of the present invention;

FIG. 12 is a schematic diagram of a display state of a display screen ofa mobile phone according to an embodiment of the present invention;

FIG. 13 is a schematic diagram of a structure of a terminal deviceaccording to an embodiment of the present invention; and

FIG. 14 is a schematic diagram of a structure of a terminal deviceaccording to an embodiment of the present invention.

DETAILED DESCRIPTION OF ILLUSTRATIVE EMBODIMENTS

The following describes technical solutions of embodiments in thisapplication with reference to accompanying drawings in the embodimentsof this application.

A terminal device in the embodiments of this application may also bereferred to as user equipment (user equipment, UE). The terminal devicemay be a smartphone, a tablet computer, various wearable devices, avehicle-mounted device, or the like. Various application programs, suchas WeChat and Maps, may be installed on the terminal device.

“A plurality of” in the embodiments of this application indicates “twoor more”.

In addition, it should be understood that in descriptions of thisapplication, terms such as “first” and “second” are merely used fordifferentiation and description, but should not be understood as anindication or implication of relative importance or an indication orimplication of an order.

The embodiments of this application provide a photographing method and aterminal device. The method is applicable to the terminal device. FIG. 1is a structural diagram of a possible terminal device. Referring to FIG.1 , the terminal device 100 includes components such as a radiofrequency (Radio Frequency, RF) circuit 110, a power supply 120, aprocessor 130, a memory 140, an input unit 150, a display unit 160, acamera 170, a communications interface 180, and wireless fidelity(Wireless Fidelity, Wi-Fi) module 190. It can be understood by a personskilled in the art that the structure of the terminal device shown inFIG. 1 does not constitute a limitation on the terminal device, and theterminal device provided in this embodiment of this application mayinclude more or fewer components than those shown in the figure, combinesome components, or have different component arrangements.

The following describes constituent components of the terminal device100 in detail with reference to FIG. 1 .

The RF circuit 11 o may be configured to receive and send data in acommunication or call process. Specifically, after receiving downlinkdata from a base station, the RF circuit 110 sends the downlink data tothe processor 130 for processing, and sends to-be-sent uplink data tothe base station. The RF circuit 11 o usually includes but is notlimited to an antenna, at least one amplifier, a transceiver, a coupler,a low noise amplifier (Low Noise Amplifier, LNA), a duplexer, and thelike.

The RF circuit 110 may further communicate with a network and anotherdevice through radio communications. Any communications standard orprotocol may be used for the radio communications, including but notlimited to a global system for mobile communications (Global System ofMobile communication, GSM), a general packet radio service (GeneralPacket Radio Service, GPRS), code division multiple access (CodeDivision Multiple Access, CDMA), wideband code division multiple access(Wideband Code Division Multiple Access, WCDMA), long term evolution(Long Term Evolution, LTE), an email, a short message service (ShortMessaging Service, SMS), and the like.

A Wi-Fi technology belongs to a short-range wireless transmissiontechnology. The terminal device 100 may connect to an access point(Access Point, AP) by using the Wi-Fi module 190, so as to gain accessto a data network. The Wi-Fi module 190 may be configured to receive andsend the data in the communication process.

The terminal device 100 may be physically connected to the anotherdevice by using the communications interface 18 o. Optionally, thecommunications interface 18 o is connected to a communications interfaceof the another device by using a cable, so as to transmit the databetween the terminal device 100 and the another device.

In this embodiment of this application, the terminal device 100 canimplement a communication service and send information to anothercontact. Therefore, the terminal device 100 is required to have a datatransmission function. In other words, a communications module needs tobe included in the terminal 100. Although FIG. 1 shows communicationsmodules such as the RF circuit 11 o, the Wi-Fi module 190, and thecommunications interface 180, it may be understood that the terminaldevice 100 includes at least one of the foregoing components or anothercommunications module (for example, a Bluetooth module) configured toimplement communication, so as to transmit the data.

For example, when the terminal device 100 is a mobile phone, theterminal device 100 may include the RF circuit 11 o, and may furtherinclude the Wi-Fi module 19 o; when the terminal device 100 is acomputer, the terminal device 100 may include the communicationsinterface 180, and may further include the Wi-Fi module 19 o; and whenthe terminal device 100 is a tablet computer, the terminal device 100may include the Wi-Fi module.

The memory 140 may be configured to store a software program and amodule. The processor 130 runs the software program and the modulestored on the memory 140, to execute various function applications ofthe terminal device 100 and processes the data.

Optionally, the memory 140 may mainly include a program storage area anda data storage area. The program storage area may store an operatingsystem, various application programs (such as a communicationapplication), a facial recognition module, and the like. The datastorage area may store data (for example, multimedia files such asvarious pictures and video files, and a face information template)created based on use of the terminal device, and the like.

In addition, the memory 140 may include a high-speed random accessmemory, and may further include a nonvolatile memory, for example, atleast one magnetic disk storage device, a flash memory device, oranother volatile solid-state storage device.

The input unit 150 may be configured to receive numbers orcharacteristic information entered by a user, and generate key signalinput related to user setting and function control of the terminaldevice 100.

Optionally, the input unit 150 may include a touch panel 151 and anotherinput device 152.

The touch panel 151 is also referred to as a touchscreen, may collect atouch operation (for example, an operation of the user on the touchpanel 151 or near the touch panel 151 by using any appropriate object oraccessory such as a finger or a stylus) of the user on or near the touchpanel 151, and drive a corresponding connection apparatus according to apreset program. Optionally, the touch panel 151 may include two parts: atouch detection apparatus and a touch controller. The touch detectionapparatus detects a touch orientation of the user, detects a signalbrought by a touch operation, and transfers the signal to the touchcontroller. The touch controller receives touch information from thetouch detection apparatus, converts the touch information into contactcoordinates, and sends the contact coordinates to the processor 130, andcan receive and execute a command sent by the processor 130. Inaddition, the touch panel 151 may be, for example, a resistive,capacitive, infrared, or surface acoustic touch panel.

Optionally, the another input device 152 may include but is not limitedto one or more physical keyboards, a function key (for example, a volumecontrol button or a power on/off button), a tracking ball, a mouse, ajoystick, and the like.

The display unit 160 may be configured to display information entered bythe user, information provided for the user, and various menus of theterminal device 100. The display unit 160 is a display system of theterminal device 100, and is configured to present a screen to implementhuman-computer interaction.

The display unit 160 may include a display panel 161. Optionally, thedisplay panel 161 may be configured in a form of a liquid crystaldisplay (Liquid Crystal Display, LCD) screen, an organic light emittingdiode (Organic Light-Emitting Diode, OLED), or the like.

Further, the touch panel 151 may cover the display panel 161. Afterdetecting the touch operation on or near the touch panel 151, the touchpanel 151 transfers information about the touch operation to theprocessor 130 to determine a touch event type. Subsequently, theprocessor 130 provides corresponding visual output on the display panel161 based on the touch event type.

Although in FIG. 1 , the touch panel 151 and the display panel 161 serveas two discrete components to implement input and input functions of theterminal device 100. However, in some embodiments, the touch panel 151may be integrated into the display panel 161 to implement the input andoutput functions of the terminal device 100.

The processor 130 is a control center of the terminal device 100,connects to the components by using various interfaces and lines, andruns or executes the software program and/or the module stored on thememory 140 and invokes the data stored on the memory 140, to performvarious functions of the terminal device 100 and process the data, andimplement a plurality of services based on the terminal device.

Optionally, the processor 130 may include one or more processing units.Optionally, the processor 130 may integrate an application processor anda modem processor. The application processor mainly processes anoperating system, a user interface, an application program, and thelike. The modem processor mainly processes the radio communications. Itmay be understood that the modem processor may alternatively not beintegrated into the processor 130.

The camera 170 is configured to implement a photographing function ofthe terminal device 100, to photograph a picture or a video. The camera170 may further be configured to implement a scanning function of theterminal device 100, and scan a scanning object (a two-dimensionalcode/bar code).

The terminal device 100 further includes the power supply 120 (such as abattery) configured to supply power to the components. Optionally, thepower supply 120 may be logically connected to the processor 130 byusing a power management system, to implement functions such as chargemanagement, discharge management, and power consumption management byusing the power management system.

Although not shown, the terminal device 100 may further include at leastone sensor, an audio circuit, and the like. Details are not describedherein.

Embodiments of this application provide a photographing method and aterminal device. In the method, a terminal device may identify aphotographed object in a preview image, and recommend text informationsuch as a poem or a song that matches the photographed object, andprompt information to a user, to indicate a missing photographed objector a redundant photographed object in the preview image to the user. Theuser may adjust a photographing range/angle and the like based on theprompt information, to obtain a high-quality image. In this manner, theuser who does not grasp a photographing technique can also photographthe high-quality image. The photographing method provided in thisembodiment of this application is applicable to the terminal device 100shown in FIG. 1 . Therefore, in the following description, the terminaldevice 100 is used as an example for description. Specifically, refer toFIG. 2 . FIG. 2 is a flowchart of a photographing method according to anembodiment of this application. As shown in FIG. 2 , a procedure of themethod includes:

S201: The terminal device 100 displays a preview image, where thepreview image includes at least one photographed object.

In this embodiment of this application, the terminal device 100 maystart an application program having a photographing function to start acamera 170. The application program having the photographing functionmay be a camera application embedded in the terminal device 100, oranother application program installed on the terminal device 100, forexample, an application program, such as BeautyCam, MIX, Beauty Camera,WeChat, Alipay, Tencent chat software (QQ), Ding Talk, or photo sharing(Instagram), Kakao Talk, or LINE (Line) having the photographingfunction.

A camera embedded in the terminal device 100 is used as an example. Whenthe user needs to photograph a photo, the user may trigger an icon ofthe camera displayed on the terminal device 100 to start the camera. Aprocessor 130 of the terminal device 100 runs the camera, starts thecamera 170, and displays the preview image on a display panel 161 of adisplay unit 160. When the user points the camera 170 at thephotographed object, the photographed object is displayed in the previewimage.

S202: The terminal device 100 identifies the at least one photographedobject included in the preview image, and matches appropriate textinformation based on the identified photographed object, where the textinformation may include a poem, a song, a proverb, a famous quote, aninternet buzzword, or the like.

For example, when identifying the at least one photographed objectincluded in the preview image, the terminal device 100 may collect oneor more frames of preview images, and then identify an image in thecollected preview image. When collecting the preview image, the terminaldevice 100 may start to collect the preview image at a moment when theterminal starts the camera 170, and stop the collection until a momentwhen the terminal device 100 detects that the user triggers aphotographing button. Alternatively, the terminal device 100 starts tocollect the preview image at a moment when the terminal starts thecamera 170, and stops the collection until a moment when the terminaldevice 100 determines that the terminal device 100 is already in astationary state or the photographed object in the preview image isstably displayed.

After collecting the preview image, the terminal device 100 may identifythe photographed object in the preview image. The photographed objectmay include various content, for example, a person, an animal, food, aflower, a green plant, a mountain, a river, a stage, a beach, awaterfall, a night scene, a blue sky, and a snow scene. Afteridentifying the photographed object included in the preview image, theterminal device 100 may match, in a database, appropriate textinformation based on the identified photographed object. In thefollowing description, that the text information is mainly the poem isused as an example. In an example, when matching the appropriate textinformation based on the identified photographed objects, the terminaldevice 100 may match the text information by keyword matching.

For example, after identifying the photographed object, the terminaldevice 100 extracts characteristic information from the photographedobject, determines, based on a mapping relationship betweencharacteristic information and keywords, keywords corresponding to theextracted characteristic information, and then matches, in the database,text information including these keywords based on the determinedkeyword.

For example, when the extracted characteristic information included inthe photographed object is a person, the terminal device 100 obtains,based on the mapping relationship, keywords corresponding to the person.For example, the obtained keywords corresponding to the person includethree keywords: “person”, “her”, and “he”. The terminal device 100 maymatch, in the database, text information that includes a keyword in thethree keywords. In this embodiment of this application, the mappingrelationship between the characteristic information and the keywords maybe stored locally or on a server. Further, the user may also modify themapping relationship. For example, “under the pines I questioned theboy, my master's off gathering herbs” does not have the three keywords“person”, “her”, and “he”. The user may add a keyword “boy” to themapping relationship. To be specific, “boy” is added to the keywordcorresponding to the person in the mapping relationship. In anotherexample, keywords in all the text information stored on the terminaldevice or the server may be matched with the characteristic informationin advance. For example, when the stored text information includes“under the pines I questioned the boy, my master's off gathering herbs”,keywords such as “boy”, and “master” may be matched with thecharacteristic information “person” in advance. In a subsequentphotographing process, when the characteristic information included inthe photographed object extracted by the terminal device 100 has theperson, the line of poem “under the pines I questioned the boy, mymaster's off gathering herbs” may be matched. Alternatively, when thestored text information includes “looking up, I find the moon bright,bowing, in homesickness I'm drowned”, “as the bright moon shines overthe sea, from far away you share this moment with me”, keywords such as“bright moon” may be matched with characteristic information “moon” inadvance. In a subsequent photographing process, when the characteristicinformation included in the photographed object extracted by theterminal device 100 has the moon, the two lines of poems may be matched.

In another example, when matching the appropriate text information basedon the identified photographed object, the terminal device 100 may usedifferent manners based on different quantities of photographed objects.

In an actual application process, the terminal device 100 may identifyat least one type of photographed object.

When identifying only one type of photographed object, the terminaldevice 100 searches the database for text information matching thephotographed object, and then recommends the text information to theuser.

When identifying the at least one type of photographed object, theterminal device 100 may combine the identified photographed objects. Forexample, the terminal device 100 identifies three photographed objects.It is assumed that the three photographed objects correspond to threekeywords. If there is text information including the three keywords, theterminal device 100 recommends the text information to the user. Ifthere is not the text information including the three keywords, thethree keywords are combined every two to obtain three combinations. Eachcombination includes two keywords. Then, the terminal device 100separately searches for whether there is text information including thetwo keywords of a combination. If there is the text information, theterminal device 100 recommends the text information to the user. Ifthere is not the text information, the terminal device 100 separatelymatches appropriate text information based on each of the threekeywords. If there is the text information including a keyword, theterminal device 100 recommends the text information to the user.

Optionally, the terminal device 100 may randomly combine the identifiedphotographed objects, or may combine the identified photographed objectsbased on weights of the identified photographed objects. If the terminaldevice 100 combines the identified photographed objects based on theweights of the identified photographed objects, the terminal device 100needs to evaluate a weight of each photographed object. For example, aweight may be set based on a proportion of a display area of thephotographed object to a display area of an entire preview image. Alarger weight of the photographed object may be set for a largerproportion of the display area of the photographed object to the displayarea of the entire preview image. For example, the terminal device 100identifies three photographed objects. It is assumed that a display areaof a first photographed object of the three photographed objects in thepreview image is the largest, and a display area of a third photographedobject is the smallest. The terminal device 100 sorts weights of thethree photographed objects: a weight of the first photographed object>aweight of a second photographed object>a weight of the thirdphotographed object. The terminal device 100 may preferably consider acombination of photographed objects with comparatively high weights.Certainly, if a proportion of the display area of the third photographedobject to the area of the entire preview image is less than a presetvalue, the terminal device 100 may also ignore the third photographedobject. Certainly, the terminal device 100 may evaluate the weight ofeach photographed object in a plurality of manners. For example, theterminal device 100 evaluates the weight of each photographed objectbased on brightness, a color saturation rate, or the like of eachphotographed object.

In still another example, in an actual application, there may be aplurality of types of appropriate text information matched by theterminal device 100 based on the identified photographed object. Forexample, one photographed object is identified, and the photographedobject identified by the terminal device 100 includes the moon. Theterminal device 100 can find, in the database, the plurality of types oftext information matching the moon, for example, “looking up, I find themoon bright, bowing, in homesickness I'm drowned”, “as the bright moonshines over the sea, from far away you share this moment with me”. Torecommend comparatively appropriate text information to the user, theterminal device 100 may further obtain other information, and select,based on the other information, the comparatively appropriate textinformation from the plurality of types of matched text information.

In a possible implementation, the terminal device 100 may detect currenttime or date, and select the comparatively appropriate text informationfrom the plurality of types of text information based on the detectedtime (or date). The time herein may be a specific moment, or may be atime period.

For example, the terminal device 100 identifies that the photographedobject in the preview image includes the sun, and the text informationdetermined by the terminal device 100 includes two lines of poems: “thesun dips down in the west, and the lovesick traveler is still at the endof the world “over the waves the sun glows, redder than fire, and thespring water flows, as blue as sapphire”. If the terminal device 100detects that the current time is 18:00, the terminal device 100determines that “the sun dips down in the west, and the lovesicktraveler is still at the end of the world” is a comparativelyappropriate poem.

In another possible implementation, the terminal device 100 may furtherdetect a current geographical location of the terminal device 100, andselect the comparatively appropriate text information from the pluralityof types of text information based on the geographical location.

For example, if the photographed object identified by the terminaldevice 100 in the preview image includes a flower, a grass, and abridge, and corresponding keywords are “grass” and “bridge”, theterminal device 100 searches the database for a poem including the twokeywords. For example, the terminal device 100 finds two lines of poems:“beside the Bridge of Birds rank grasses overgrow, over the Street ofMansions the setting sun hangs low” and “in the water, a mountain isdistant and a cloud looks like snow, and a grass near the bridge likes asmoke”. If the terminal device 100 detects that the terminal device 100is currently located at the “Street of Mansions” in Nanjing, theterminal device 100 determines that “beside the Bridge of Birds rankgrasses overgrow, over the Street of Mansions the setting sun hangs low”is the comparatively appropriate poem.

In still another possible implementation, when the terminal device 100matches the plurality of types of text information based on thephotographed object, the terminal device 100 may determine one type oftext information from the plurality of types of text informationaccording to a priority policy. For example, the terminal device 100 maydetermine priorities of the plurality of types of text information, andrecommend text information with a comparatively high priority level tothe user. Optionally, priority levels between different text informationmay be obtained based on the use habit of the user. For example, if theuser often selects “looking up, I find the moon bright, bowing, inhomesickness I'm drowned”, a priority level of “looking up, I find themoon bright, bowing, in homesickness I'm drowned” is higher than apriority level of “As the bright moon shines over the sea, from far awayyou share this moment with me”. Therefore, the terminal device 100recommends “looking up, I find the moon bright, bowing, in homesicknessI'm drowned” to the user.

In this embodiment of this application, the priority level may beupdated. For example, after the terminal device 100 recommends the textinformation to the user, the user selects to use other text information.When the terminal device 100 detects that a quantity of times that theuser uses the other text information exceeds a preset quantity of times,the terminal device 100 may improve a priority of the other textinformation, and update the priority policy.

Certainly, in an actual application process, the terminal device 100 maysearch for the appropriate text information based on the time, thegeographical location, the keyword of the photographed object, and otherinformation.

In this embodiment of this application, the poem, the song, the proverb,the famous quote, the internet buzzword, or the like may be storedlocally on the terminal device 100. Certainly, terminal 100 may alsoobtain the poem, the song, the proverb, the famous quote, the internetbuzzword, or the like from a network or a server.

S203: The terminal device 100 outputs the text information and/or promptinformation, where the prompt information is used to indicate a missingor redundant photographed object in the preview image to the user. Forexample, there are M photographed objects in the preview image of theterminal device. When the text information is matched based on thesephotographed objects, only N photographed objects in the M photographedobjects match the appropriate text information. The redundantphotographed object is remaining (M−N) photographed objects obtainedafter the N photographed objects are removed from the M photographedobjects. In this case, the redundant photographed object may beindicated to the user. According to the indication, the user may move aposition or an angle of the terminal device, so that the preview imagedoes not include these redundant photographed objects. In other words,the redundant photographed object is not photographed, so as to achievea better photographing effect. In another case, when the textinformation is matched based on the M photographed objects, if thematched text information further includes another object other than theM photographed objects, the another object is the missing photographedobject. Likewise, the terminal device may indicate the missingphotographed object to the user. According to the indication, the usermay move the position or the angle of the terminal device, so that themissing photographed object is added to the preview image. In otherwords, the missing photographed object is photographed, so as to achievethe better photographing effect.

For example, it can be learned from the foregoing content that when theterminal device 100 identifies that the preview image includes theplurality of photographed objects, and the plurality of photographedobjects may be combined. The text information is determined based on acombined photographed object. Therefore, some redundant photographedobjects in the plurality of photographed objects in the preview imagemay appear. For example, the photographed objects included in thepreview image have a person, a sea, and the moon. The terminal device100 determines the poem “as the bright moon shines over the sea, fromfar away you share this moment with me” based on the sea and the moon,and the person is redundant. In this case, the terminal device 100 maydisplay the prompt information, and the prompt information is used toindicate the redundant photographed object, namely, the person in thecurrent preview image to the user.

For another example, the text information usually also includes aplurality of keywords. Therefore, the text information matched by theterminal device 100 may include a keyword, but the preview image doesnot include a photographed object corresponding to the keyword.Therefore, the terminal device 100 may display the prompt information,and the prompt information is used to indicate the missing photographedobject corresponding to the keyword in the text information in thecurrent preview image to the user.

In this embodiment of this application, if there is no redundant ormissing photographed object in the preview image, in other words, if Mkeywords corresponding to the M photographed objects in the previewimage match M keywords included in the text information one by one, theterminal device 100 may not display the prompt information.

In this embodiment of this application, the prompt information may be avoice message. In other words, the terminal may instruct the user byplaying a voice, or the prompt information may be content that can bedisplayed on a display screen, such as text, an icon, or an image. Theprompt information may be specifically displayed in a preview screen, tohelp instruct the user.

For example, the prompt information is the text. A prompt dialog box maybe displayed in the preview image of the terminal device 100, and theprompt dialog box includes the text such as “add a river”, “move thecamera to add a river”, “redundant person”, or “move the camera todelete the person”.

After the text information is matched, the terminal device 100 mayfurther display matching degree information on the display screen, andthe matching degree information is used to indicate a matching degreebetween the text information and the matched text information. Thematching degree information may be displayed in a form of a number, forexample, displayed as a matching degree percentage. Certainly, thematching degree information may also be displayed in another form, forexample, displayed in an expression manner. When the expression issmiling, it indicates that the matching degree is comparatively high.When the expression is sad, it indicates that the matching degree iscomparatively low.

In this embodiment of this application, the terminal device 100 maycollect the preview image in real time, match, in the database, theappropriate text information based on the photographed object includedin the collected preview image, and display the matched textinformation, the matching degree information, and the promptinformation, to indicate the missing or redundant photographed object inthe preview image to the user. The user may adjust a photographingrange/angle, and the like based on the prompt information. When theposition of the terminal device is moved or a focal length is changed toadjust the photographing range/angle, the preview image changes, and theterminal re-matches text information based on a photographed object in achanged preview image. If the re-matched text information changescompared with the previous text information, the matching degreeinformation and the prompt information also correspondingly change, andthe terminal may display changed matching degree information and promptinformation. In other words, when the preview image dynamically changes,the text information, the matching degree information, and the promptinformation also dynamically changes.

For example, FIG. 3A to FIG. 3E are schematic diagrams of display statesof a display screen of a mobile phone.

In FIG. 3A, a preview screen 301 is displayed on a display screen of amobile phone 300, the preview screen 301 includes a preview image andsome control keys (such as a flash light and a camera switch), thepreview image includes a poem 302 “love the quiet grass growing by theside of the brook, overhead warble the orioles in the depth of woods”matched by the mobile phone 300, and the preview image further includesa matching degree 303: 50%.

The mobile phone 300 may further display, on the preview screen 301, akeyword that is in the poem 302 and that matches the photographed objectincluded in a current preview image. Refer to FIG. 3B.

In FIG. 3B, a keyword “grass” in the poem 302 “love the quiet grassgrowing by the side of the brook, overhead warble the orioles in thedepth of woods” is in a solid coil, to indicate the user that thephotographed object included in the preview image matches “grass” in thepoem 302. Certainly, in FIG. 3B, only as an example, the word “grass” isdisplayed in a solid wire frame. In an actual application, there may beanother display manner, such as highlighting, a bubble, or bolding,provided that an objective of informing the user is achieved.

In addition, a keyword “orioles” in the poem 302 “love the quiet grassgrowing by the side of the brook, overhead warble the orioles in thedepth of woods” in FIG. 3B is in a dashed circle, to indicate the userthat, in the current preview image, there is a missing photographedobject corresponding to the keyword “orioles”. In FIG. 3B, only as anexample, the word “orioles” is displayed in a dashed wire frame. Theremay be another manner used to indicate the user that, in the currentpreview image, there is the missing photographed object corresponding tothe keyword “orioles”.

For example, the mobile phone 300 may display a prompt dialog box 304 inthe preview image. Text “add orioles” is displayed in the prompt dialogbox 304. Refer to FIG. 3C.

In an example, the mobile phone 300 may further display indicationinformation (in a form of an arrow, text, or the like) of moving adirection, and the indication information about moving the direction isused to instruct the user to adjust a photographing range in anindicated moving direction. Refer to FIG. 3D. An upward arrow 305 isdisplayed in the preview image in FIG. 3D, to instruct the user to movethe photographing range upward. Alternatively, the mobile phone mayfurther display, in the preview image, instruction information foradjusting a focal length (a distance between an object and thephotographed object), to instruct the user to increase (or shorten) thefocal length, to obtain more (or fewer) photographed objects. Theinstruction information for adjusting the focal length may be text, anicon, or the like.

When the user moves the mobile phone 300 or the user adjusts the focallength, more photographed objects or different photographed objects mayappear in the preview image. Refer to FIG. 3E.

In FIG. 3E, the preview screen 301 is displayed on the display screen ofthe mobile phone 300, the preview screen 301 includes a preview image,the preview image includes more photographed objects, and the poem 302“love the quiet grass growing by the side of the brook, overhead warblethe orioles in the depth of woods” matched by the mobile phone, and thepreview image further includes a matching degree 305: 80%. In addition,both “grass” and “orioles” in the poem 302 are displayed in solid lineframes, to indicate the user that the photographed object included inthe current preview image matches “grass” and “orioles”.

In FIG. 3A to FIG. 3E, that one line of poem is displayed in the previewimage is used as an example. Certainly, the mobile phone may furtherdisplay a plurality of lines of poems in the preview image. For example,there are two lines of poems matched by the mobile phone based on thephotographed object in the preview image. The mobile phone may displaythe two lines of poems in the preview image, and the user may select aline of poem of interest from the two lines of poems. Referring to FIG.4 , a preview screen 401 is displayed on a display screen of a mobilephone 400, a preview image is displayed on the preview screen 401, andthe preview image includes two lines of poems: a line of poem 402 and aline of poem 403. The user may select a line of poem by using a userfinger and slide left/right to cancel the line of poem. Certainly, theremay be another cancellation manner. This is not limited in thisembodiment of this application.

Certainly, a poem displayed by the mobile phone is not necessarilypreferred by the user. In this embodiment of this application, the usermay select a poem based on a requirement of the user.

A possible implementation is that the user may select a type of a poem,and the mobile phone matches an appropriate poem based on the type ofthe poem selected by the user. For example, if the type of the poemselected by the user is a landscape pastoral poem, the mobile phonerecommends a poem of a pastoral poem type to the user.

For example, referring to FIG. 5 , an identifier 501 of a poem type isdisplayed in a preview image of a mobile phone 500. When the usertriggers the identifier 501, the mobile phone displays a plurality typesof poems, and the user selects a type of a poem.

In another possible implementation, if the user wants to try anotherpoem, the user may choose to change the poem.

For example, referring to FIG. 6 , a refresh (or change a control)control 601 is displayed on a preview screen 601 of a mobile phone 600.After the user triggers the refresh control 601, the mobile phone 600displays another poem.

It can be learned from the foregoing content that, in a process ofmatching the text information based on the photographed object, themobile phone needs to search the database for the appropriate textinformation. The text information may be stored locally on the mobilephone or stored on a server. Therefore, in a case in which the mobilephone is not connected to a network, after the user triggers the“refresh” control 601, the mobile phone can search for the appropriatetext information in a local database. In a case in which the mobilephone is connected to the network, after the user triggers the “refresh”control 601, the mobile phone can search for the appropriate textinformation both in the local database and in the server. For example,the mobile phone may send a reserved image to the server, and the serverperforms a process of identifying the photographed object in thereserved image and matching the text information, or the mobile phonemay identify the photographed object in the preview image, and then senda keyword corresponding to the identified photographed object to theserver. The server matches an appropriate poem based on the receivedkeyword, and then the server sends the matched poem to the mobile phone.

In FIG. 6 , that the “refresh” control 601 and a poem are displayed in asame frame is merely an example. The “refresh” control 601 may furtherbe displayed in another position, or may be displayed in another manner,for example, displayed in an icon manner. This is not limited in thisembodiment of this application.

Certainly, the user can also view a used poem in “historical record”.

For example, referring to FIG. 7 , a “historical record” control 701 isdisplayed on a display screen of a mobile phone 700. After the usertriggers the “historical record” control 701, the mobile phone 700displays a list, and the list displays a displayed poem. Likewise, inFIG. 7 , that the “historical record” control 701 and a poem aredisplayed in a same frame is merely an example. The “historical record”control 701 may further be displayed in another position, or may bedisplayed in another manner. This is not limited in this embodiment ofthis application.

In an example, in this embodiment of this application, the poem and thematching degree information may be specified position information (theposition may be set by the user) in the preview image, or may bedisplayed in a blank area in the preview image. Referring to FIG. 8 ,the poem and the matching degree information are displayed in the blankarea in the preview image of a mobile phone 800. In this manner, thepoem and the matching degree information may not shield the photographedobject in the preview image as much as possible, and are convenient forthe user to view, to help instruct the user to photograph an image.

In another example, because the matching degree information is mainlyinformation used to instruct the user to photograph the image, thematching degree information and the poem may be displayed in the previewimage. After the user triggers a photographing button, only the poem isdisplayed in a final photographed image. The user may select a fontform, for example, a font such as a Song typeface or a Kai typeface, fordisplaying the poem in the finally photographed image. The poem can bedisplayed statically or dynamically. For example, each word in the poemmay be displayed one by one, to present a dynamic display effect. Thepoem may be displayed in a blank area in the finally photographed image,to avoid shielding display content in the image. Certainly, thesolutions provided in this embodiment of this application are mainlyused to instruct the user to photograph an image with better quality.Therefore, after the user triggers the photographing button, the poemmay not be displayed in the final photographed image, or after the usertriggers the photographing button, two photographed images are finallyobtained: One does not include a poem, and the other includes a poem.

In the foregoing description, after identifying the photographed objectfrom the preview image, the mobile phone determines poem that matchesthe photographed object, and then displays the poem and the promptinformation in the preview image. In another implementation, the mobilephone may not display the poem, but only display the prompt information,to indicate a missing or redundant photographed object in the previewimage to the user. The user may photograph an image with a better effectbased on the prompt information. In this case, after the mobile phonedetects that the user triggers the photographing button, thephotographed object may not include the poem.

In the foregoing embodiment, the prompt information mainly indicates themissing or redundant photographed object in the preview image to theuser. The prompt information may further instruct the user to replace aredundant photographed object in the preview image with anotherphotographed object. In this manner, the mobile phone may firstdetermine a redundant first photographed object, then determine amissing second photographed object, and then output the promptinformation to instruct the user to replace the first photographedobject with the second photographed object.

In the photographing manner provided in this embodiment of thisapplication, the terminal device may identify the photographed object inthe preview image, and recommend the text information such as the poemor the song that matches the photographed object, and the promptinformation to the user, to indicate the missing or redundantphotographed object in the preview image to the user. The user mayadjust the photographing range/angle and the like based on the promptinformation, to obtain a high-quality image. In this manner, a user whodoes not grasp a photographing technique can also photograph thehigh-quality image.

In an actual application, the user may select to enable a poemphotographing mode or disable a poem photographing mode.

In an example, a poem matching mode may be set on the preview screen ofthe mobile phone. After the user enables the poem matching mode, themobile phone may perform steps S201 to S203.

For example, FIG. 9A is a schematic diagram of a preview screendisplaying on a display screen of a mobile phone.

In FIG. 9A, the preview screen 901 is displayed on the display screen ofthe mobile phone 900, the preview screen 901 includes a photographingmode selection box 902, and the photographing mode selection boxincludes a control 903 corresponding to a poem mode. The user triggersthe control 903 to enable the poem mode. The mobile phone performs thesteps S201 to S203 in the embodiment shown in FIG. 2 , and the textinformation and the matching degree information are displayed on thedisplay screen. If the user triggers the control 903 again, the mobilephone 900 disables the poem mode, and the text information and thematching degree information on the display screen of the mobile phone900 disappear.

Generally, when photographing a landscape, the user more expects toattach text information with verse to a photographed landscape photo, toimprove an artistic effect of the photo. Therefore, in an example, whendetecting that the photographed object included in a current previewimage belongs to a landscape type such as a mountain, water, a plant, adesert, or an attic, the mobile phone may display an identifier (text oran icon) of the poem mode in the preview image, to remind the user toenable the poem mode. Refer to FIG. 9B.

In FIG. 9B, the preview screen 901 is displayed on the display screen ofthe mobile phone 900, the preview screen 901 includes the preview image,and the preview image includes an icon 904 of the poem mode. When theuser triggers the icon 904, the mobile phone 900 enables the poem mode.When the user triggers the icon 904 again, the mobile phone 900 disablesthe poem mode.

In the embodiment shown in FIG. 2 , the terminal device may identify thephotographed object in the preview image, and recommend the textinformation such as the poem or the song that matches the photographedobject, and the prompt information to the user, to indicate the missingor redundant photographed object in the preview image to the user. Theuser may adjust the photographing range/angle and the like based on theprompt information, to obtain the high-quality image. The followingdescribes another embodiment. In the following embodiment, afteridentifying a plurality of photographed objects included in a previewimage, a terminal device may recommend music that matches the identifiedphotographed object, so that a user may synthesize the recommended musicand the photographed image into an audio image. The method may beapplicable to the terminal device 100 shown in FIG. 1 . Therefore, theterminal device 100 is used as an example in the following description.Referring to FIG. 10 , a procedure of the method includes:

S1001: The terminal device 100 displays a preview image, where thepreview image includes at least one photographed object.

S1002: The terminal device 100 identifies the at least one photographedobject included in the preview image, and matches appropriate musicbased on the identified photographed object.

In an example, when matching the appropriate music based on theidentified photographed objects, the terminal device 100 may match themusic by keyword matching.

For example, after identifying the photographed objects, the terminaldevice 100 extracts characteristic information from the photographedobjects, determines, based on a mapping relationship betweencharacteristic information and keywords, keywords corresponding to theextracted characteristic information, and then matches, in the database,music whose lyrics include these keywords or whose name includes thesekeywords based on the determined keywords.

In another example, when matching the appropriate music based on theidentified photographed objects, the terminal device 100 may match themusic based on information about a scenario in which the photographedobjects are located.

For example, when the terminal device 100 identifies that thephotographed objects are in a scenario such as a bar, a karaoke, or astage, the terminal device 100 may search for music appropriate forplaying in the bar, the karaoke, or the stage.

In another example, when matching the appropriate music based on theidentified photographed objects, the terminal device 100 may match themusic based on information about an environment in which the terminaldevice 100 is currently located.

For example, in a process of collecting the preview image, the terminaldevice 100 may also collect a sound of an ambient environment. When acollected sound of the ambient environment is comparatively low, theterminal device 100 may search for light music, or when a collectedsound of the ambient environment is comparatively loud, heavy music maybe selected.

In another example, when matching the appropriate music based on theidentified photographed objects, the terminal device 100 may match themusic based on a current time.

For example, the terminal device 100 may detect the current time, anddetermine the appropriate music based on the detected time. For example,if the current time is at night, the terminal may search for lightmusic.

In another example, when matching the appropriate music based on theidentified photographed objects, the terminal device 100 may match themusic based on a current geographic location.

For example, the terminal device 100 may detect the current geographicallocation, and search for the appropriate music based on the geographicallocation. For example, if the terminal device 100 detects that theterminal device 100 is currently located in Hong Kong, the terminaldevice 100 searches for Cantonese music, and if the terminal device 100detects that the terminal device 100 is currently located in America,the terminal device 100 searches for European and American music.

In this embodiment of this application, the terminal device 100 may alsomatch another sound other than the music. For example, when the terminaldevice 100 identifies that the photographed objects include an animal,the terminal device 100 may search for a sound of the animal from aserver or locally. For example, if the photographed objects include abird, the terminal device 100 may search for a bird call.

In an actual operation process, the terminal device may combine theforegoing several manners for use.

In this embodiment of this application, the music may be stored locallyon the terminal device 100 or stored on the server. Therefore, in a casein which the terminal device 100 is not connected to a network, theterminal device 100 may search for the appropriate music in a localdatabase. In a case in which a mobile phone is connected to the network,the terminal device 100 can search for the appropriate music bothlocally and in the server. For example, the terminal device 100 may sendthe preview image to the server. The server identifies the photographedobjects in the preview image and matches the appropriate music. Then,the server sends information related to the matched music to theterminal device 100. Alternatively, the terminal device 100 may identifythe photographed objects in the preview image, and then send keywordscorresponding to the identified photographed objects to the server. Theserver matches the appropriate music based on the received keywords, andthen the server sends information related to the matched music to theterminal device 100.

In this embodiment of this application, the music may be a musicsegment, for example, a music segment whose total playing duration is 10s to 12 s. Therefore, the terminal device 100 or the server may store amusic segment that has been captured, or after determining theappropriate music, the terminal device 100 or the server captures anappropriate music segment from the music, and then pushes the musicsegment to a user.

S1003: The terminal device 100 displays an identifier of the music,where the identifier is text or an icon.

FIG. 11 is a schematic diagram of a display state of a display screen ofa mobile phone.

In FIG. 11 , a preview screen 1101 is displayed on the display screen ofthe mobile phone 1100, the preview screen 1101 includes the previewimage, and the preview image includes an identifier 1102 of musicmatched by the mobile phone 1100. When the user triggers the identifier1102, the music may be played. If satisfied with the music, the user maytrigger a photographing control. The terminal device 100 synthesizes themusic with the photographed image to obtain the audio image.

In an actual application, the user may select to enable a music mode ordisable a music mode.

In an example, the music mode may be set on the preview screen of theterminal device 100. After the user enables the music mode, the terminaldevice 100 may perform steps S1001 to S1003.

For example, FIG. 12 is a schematic diagram of a preview screendisplaying on a display screen of a mobile phone.

In FIG. 12 , a preview screen 1201 is displayed on the display screen ofthe mobile phone 1200, the preview screen 1201 includes a photographingmode selection box 1202, and the photographing mode selection box 1202includes a control 1203 corresponding to the music mode. The usertriggers the control 1203 to enable the music mode. The mobile phone1200 performs the steps S1001 to S1003 in the embodiment shown in FIG.10 , and an identifier of recommended music is displayed on the displayscreen. If the user triggers the control 1203 again, the mobile phone1200 disables the music mode, and the identifier of the music on thedisplay screen of the mobile phone 1200 disappears.

Various implementations of this application may be randomly combined toachieve different technical effects. Therefore, various implementationsin the embodiment shown in FIG. 2 may also be applicable to theembodiment shown in FIG. 10 . In other words, when a photo or a video isphotographed, the method in the embodiment shown in FIG. 2 may be usedto indicate the missing or redundant photographed object to the user,and the method in the embodiment shown in FIG. 10 may be used to displaythe identifier of the music. After the photographing, a photo or a videoincluding text information and music may be obtained. To be specific,the user may obtain a multimedia photo or video. When the user views thephoto, the terminal can display the corresponding text information inthe photo, and can further play the corresponding music.

In the embodiments provided in this application, the method provided inthis embodiment of this application is described from a perspective inwhich the terminal device is used as an execution body. To implementfunctions in the method provided in the embodiments of this application,a terminal device may include a hardware structure and/or a softwaremodule, and implement the functions in a form of the hardware structure,the software module, or a combination of the hardware structure and thesoftware module. Whether a function in the functions is performed byusing the hardware structure, the software module, or the combination ofthe hardware structure and the software module depends on a specificapplication and a design constraint condition of the technical solution.

Based on a same concept, FIG. 13 shows a terminal device 1300 accordingto an embodiment of this application. The terminal device 1300 may be aterminal device capable of image photographing, and the terminal devicemay perform the method in the embodiment shown in FIG. 2 to FIG. 9 . Asshown in FIG. 13 , the terminal device 1300 includes a processing unit1301 and a display unit 1302.

The processing unit 1301 is configured to receive a first operation, andstart a camera in response to the first operation.

The display unit 1302 is configured to display a first preview screenincluding a first preview image, and the first preview image includes atleast one photographed object.

The processing unit 1301 is further configured to output first promptinformation based on the first preview image, and the first promptinformation is used to indicate a missing or redundant photographedobject in the first preview image. The first prompt information may belanguage prompt information or text prompt information. For example, theprocessing unit 1301 may output the voice prompt information by using aloudspeaker, or the processing unit 1301 may output the text promptinformation by using the display unit 1302.

Optionally, after outputting the first prompt information based on thefirst preview image, the processing unit 1301 is further configured toreceive a second operation, and in response to the second operation,display, by using the display unit 1302, a second preview screenincluding a second preview image. The second preview image is differentfrom the first preview image, and the second preview image includes atleast one photographed object.

The processing unit 1301 is further configured to output second promptinformation based on the second preview image. The second promptinformation is different from the first prompt information, and thesecond prompt information is used to indicate a missing or redundantphotographed object in the second preview image. Likewise, the secondprompt information may also be language prompt information or textprompt information. For example, the processing unit 1301 may output thevoice prompt information by using a loudspeaker, or the processing unit1301 may output the text prompt information by using the display unit1302.

Optionally, a preview image includes M photographed objects, the previewimage is the first preview image or the second preview image, and if Nphotographed objects in the M photographed objects match preset textinformation, the redundant photographed object is remaining (M−N)photographed objects obtained after the N photographed objects areremoved from the M photographed objects, or if text information thatmatches the M photographed objects includes a keyword corresponding toanother photographed object other than the M photographed objects, theanother photographed object is the missing photographed object, whereN≥1, and N<M.

Optionally, the first prompt information is displayed on the firstpreview screen; and the second prompt information is displayed on thesecond preview screen.

Optionally, the processing unit 1301 is further configured to outputmatched first text information based on the first preview image, anddisplay the first text information on the first preview screen by usingthe display unit 1302.

Optionally, the processing unit 1301 is further configured to outputmatched second text information based on the second preview image, anddisplay the second text information on the second preview screen byusing the display unit 1302.

Optionally, the first text information includes at least one piece oftext information, or the second text information includes at least onepiece of text information.

Optionally, the processing unit 1301 is further configured to outputfirst matching degree information based on the first preview image, anddisplay the first matching degree information on the first previewscreen by using the display unit 1302. The first matching degreeinformation is used to indicate a matching degree between the first textinformation and the first preview image.

Optionally, the processing unit 1301 is further configured to outputsecond matching degree information based on the first preview image, anddisplay the second matching degree information on the second previewscreen by using the display unit 1302. The second matching degreeinformation is used to indicate a matching degree between the secondtext information and the second preview image.

Optionally, the processing unit 1301 is further configured to outputfirst direction indication information based on the first preview image,and display the first direction indication information on the firstpreview screen by using the display unit 1302. The first directionindication information is used to instruct a user to move the terminaldevice in an indicated first direction.

Optionally, the processing unit 1301 is further configured to outputsecond direction indication information based on the first previewimage, and display the second direction indication information on thesecond preview screen by using the display unit 1302. The seconddirection indication information is used to instruct the user to movethe terminal device in an indicated second direction.

Optionally, a second control is displayed in the first preview image,and the second control is configured to trigger displaying a type oftext information. In response to a user's operation of triggering thesecond control, the processing unit 1301 displays a first list by usingthe display unit 1302. The first list includes at least one type of thetext information. In response to a user's operation of selecting a firsttype, the processing unit 1301 displays first text information by usingthe display unit 1302. A type of the first text information is the firsttype.

Optionally, the first preview screen includes a first photographingcontrol, and the processing unit 1301 is further configured to obtaintwo first photographed images in response to an operation used totrigger the first photographing control. One of the two firstphotographed images includes the first text information, and the otherfirst photographed image does not include the first text information.

Optionally, the second preview screen includes a second photographingcontrol, and the processing unit 1301 is further configured to obtaintwo second photographed images in response to an operation used totrigger the second photographing control. One of the two secondphotographed images includes the second text information, and the othersecond photographed image does not include the second text information.

Optionally, a preview image includes M photographed objects, and thepreview image is the first preview image or the second preview image.When M is 1, and when the processing unit 1301 is configured to matchtext information based on N photographed objects in the M photographedobjects, the processing unit 1301 is specifically configured to extractcharacteristic information of the photographed object, determine basedon a mapping relationship between characteristic information and akeyword, a keyword corresponding to the extracted characteristicinformation; and determine text information including the keyword.

Optionally, a preview image includes M photographed objects, and thepreview image is the first preview image or the second preview image.When M is greater than or equal to 2, and when the processing unit 1301is configured to match text information based on N photographed objectsin the M photographed objects, the processing unit 1301 is specificallyconfigured to determine the N photographed objects whose weights aregreater than a preset weight in the M photographed objects, where theweight is used to indicate a proportion of a display area of onephotographed object to a display area of an entire preview image;extract characteristic information from each of the N photographedobjects to obtain N pieces of characteristic information in total;determine, based on a mapping relationship between characteristicinformation and a keyword, N keywords corresponding to the extracted Npieces of characteristic information; and determine text informationincluding the N keywords.

Optionally, when the processing unit 1301 matches the text informationbased on the N photographed objects in the M photographed objects, theprocessing unit 1301 is further configured to determine at least twotypes of text information based on the N photographed objects in the Mphotographed objects, detect current time information/geographicallocation information; and select one type of text information from theat least two types of text information based on the timeinformation/geographical location information; or select one type oftext information from the at least two types of text informationaccording to a priority policy, where the priority policy includes apriority sequence between the at least two types of text information.

Optionally, if the user selects other text information other than thematched text information, the processing unit 1301 is further configuredto determine whether a quantity of times that the user selects the othertext information exceeds a preset quantity of times; when the quantityof times that the user selects the other text information exceeds thepreset quantity of times, set a first priority level of the other textinformation to a second priority level, where the second priority levelis higher than the first priority level; and update the priority policybased on the second priority level of the other text information.

In a specific implementation, the processing unit 1301 may be equivalentto a processor of the terminal device, and the display unit 1302 may beequivalent to a display screen of the terminal device.

Based on a same concept, FIG. 14 shows a terminal device 1400 accordingto an embodiment of this application. The terminal device 1400 may be aterminal device capable of image photographing, and the terminal devicemay perform the method in the embodiment shown in FIG. 10 to FIG. 12 .As shown in FIG. 14 , the terminal device 1400 includes a processingunit 1401 and a display unit 1402. The processing unit 1401 isconfigured to receive a first operation, and start a camera in responseto the first operation.

The display unit 1402 is configured to display a first preview screenincluding a first preview image, and the first preview image includes atleast one photographed object. The display unit 1402 is furtherconfigured to display a first identifier of first music on the firstpreview screen, the first music is music matched by the terminal devicebased on the at least one photographed object in the first previewimage, and the first identifier is text or an icon.

Optionally, after the display unit 1402 is configured to display thefirst identifier of the first music on the first preview screen, theprocessing unit 1401 is further configured to receive a secondoperation.

In response to the second operation, the display unit 1402 is furtherconfigured to display a second preview screen including a second previewimage, the second preview image is different from the first previewimage, and the second preview image includes at least one photographedobject. The display unit 1402 is further configured to display a secondidentifier of second music on the second preview screen, the secondmusic is different from the first music, the second music is musicmatched by the terminal device based on the at least one photographedobject in the second preview image, and the second identifier is text oran icon.

Optionally, the first preview screen includes a first photographingcontrol. The processing unit 1401 is further configured to obtain afirst photographed image in response to an operation used to trigger thefirst photographing control. The first photographed image is an imageobtained by the terminal device by synthesizing the first music and thefirst preview image.

Optionally, the second preview screen includes a second photographingcontrol. The processing unit 1401 is further configured to obtain asecond photographed image in response to an operation used to triggerthe second photographing control. The second photographed image is animage obtained by the terminal device by synthesizing the second musicand the second preview image.

Optionally, the terminal device further includes a sound playing unit,and the sound playing unit is configured to play the first music inresponse to an operation of triggering the first identifier.

Optionally, a second control is displayed in the preview image, and thesecond control is configured to trigger displaying a type of music. Thedisplay unit 1402 is further configured to display a first list inresponse to a user's operation of triggering the second control, and thefirst list includes at least one type of music. The display unit 1402 isfurther configured to display a first identifier of the first music inresponse to a user's operation of selecting a first type, and the typeof the first music is the first type.

In a specific implementation, the processing unit 1401 may be equivalentto a processor of the terminal device, and the display unit 1402 may beequivalent to a display screen of the terminal device.

The foregoing embodiments describe processing performed by the terminaldevice on the preview image during photographing. It should be notedthat the photographing may be photo photographing, or may be videophotographing. In addition, a photographed video image is processedsimilarly with reference to the foregoing method for processing thepreview image. For example, the video image may be processed as follows:

In a video photographing process, the photographed video image mayinclude several frames. Some consecutive frames may be in similar orconsecutive scenarios. To be specific, photographed objects in theseframes are the same or most of the photographed objects are the same.The terminal device may analyze content of each frame in thephotographed video image, and identify text information or musicinformation that matches a photographed object in each frame. Becausecontent that matches each frame may be the same or may be different,there may be a plurality of pieces of text or music that match theentire video image. Alternatively, after identifying the consecutiveframes indicating similar or consecutive scenarios, the terminal devicemay analyze content in these consecutive frames, and identify textinformation or music information that matches photographed objects inthese consecutive frames. A group of consecutive frames corresponds toone piece of text information or music information. Because an entirevideo image may include a plurality of groups of consecutive frames(scenarios indicated by all frames in one group of consecutive framesare similar or consecutive), and content that matches each group ofconsecutive frames may be the same or may be different, there may be aplurality of pieces of text or music that matches the entire videoimage. The terminal device may alternatively identify, based onphotographed objects in all image frames or some image frames in thevideo image, one piece of text information or music information thatmatches these photographed objects. Therefore, there is one piece oftext or music that matches the entire video image. In other words, onepiece of text information or music information may match the entirevideo image, or may match one frame or some frames in the video image.

A method for identifying the text information or the music informationthat matches each frame, some consecutive frames, or all image frames isthe same as the method for identifying the text information or the musicinformation that matches the preview image in the foregoing embodiment.

After the matched text information is identified, the text informationmay be displayed on a display screen in real time, or matched textinformation may be displayed on a playing screen when the video isplayed again and after the video photographing ends.

After the matched music information is identified, the matched music maybe played in real time, or matched music may be played at the same timewhen the video is played again and after the video photographing ends.

When the entire video image corresponds to only one piece of textinformation or music information, in a process of playing the entirevideo, same text may be always displayed or same music may be played.When each frame corresponds to different text information or musicinformation, or when some frames correspond to different textinformation or music information, in a process of playing the entirevideo, text that matches the current frame needs to be displayed, ormusic that matches the current frame needs to be played.

The foregoing embodiments describe processing performed by the terminaldevice during the photo photographing or the video photographing. Itshould be noted that, in addition to the processing in the photographingprocess, the embodiments of this application may further include amethod for processing a photographed photo or video. The method mayinclude:

S1501: A terminal device obtains first content, where the first contentmay be a photo or a video.

The terminal device may obtain the first content by photographing thephoto or video. The terminal device may further obtain the first contentfrom a cloud or another external device. For example, the terminaldevice downloads the photo or the video from the cloud, or the terminaldevice receives the photo or the video sent by another terminal device.

S1502: The terminal device receives a fourth operation. The fourthoperation is selecting the first content, and is willing to share thefirst content. In other words, the fourth operation indicates that auser wants to share the first content. The fourth operation may be oneoperation, or may include a plurality of operations.

The sharing may be sending to an external terminal, or may be uploadingto an external network. To be specific, as long as the first content issent by using a network, another user can obtain or view the firstcontent. A specific form of the sharing is not limited in thisembodiment. For example, the sharing may be that the terminal devicesends the first content to another one terminal device or more terminaldevices by using instant communications software (for example, WeChat orQQ), or may be that the terminal device sends the first content to aplatform of social software (for example, the WeChat or Facebook), sothat the another user of the social software can view the first content.

S1503: In response to the fourth operation, the terminal deviceidentifies an object in the first content, where at least one object inthe first content matches preset text information or audio.

The terminal device may find, locally or in the network, textinformation or audio information corresponding to one or more objects inthe first content.

S1504: The terminal device generates second content based on the firstcontent and text or audio that matches the first content.

After finding the text or audio that matches the first content, theterminal device may generate the second content based on the matchedtext or audio. For example, the terminal device may superimpose thematched text on the first content (the photo or video), to form thesecond content, or the terminal device may superimpose the matched audioinformation on the first content or associate the matched audioinformation with the first content. The audio information may includeaudio data, or may include audio data and text corresponding to theaudio data. The second content may include the matched audioinformation, or the second content may include a download address or adownload link of the matched audio information.

S1505: The terminal device shares the second content.

After generating the second content, the terminal device may firstpresent the second content. For example, the terminal device presentsthe first content on which the matched text is superimposed, or theterminal device presents the first content on which an identifier of thematched audio is superimposed. In other words, a name of the matchedaudio or an identifier of another graphic may be displayed in the firstcontent on a display screen, so that the user may learn of the matchedaudio. After the user views the second content presented by the terminaldevice, the user may choose to share the second content. After theterminal device receives an operation instruction used to instruct theterminal device to share the second content, the terminal device sharesthe second content with another device. The terminal device may sharethe second content with the another device by using various existingnetworks.

S1506: After receiving the second content, the another device presentsthe second content. Specifically, the another device may display thephoto or video including the matched text, or the another device mayplay the matched audio when displaying the photo or playing the video,and may further display the text corresponding to the audio when theaudio is played. For example, when the audio is a song, the textcorresponding to the audio may be lyrics of the song.

In this embodiment of this application, the photographed photo or videomay be processed, and the matched text or audio is automatically added.

With descriptions of the foregoing embodiments, a person skilled in theart may clearly understand that the embodiments of this application maybe implemented by hardware, firmware or a combination thereof. When theembodiments of this application are implemented by software, theforegoing functions may be stored on a computer-readable medium ortransmitted as one or more instructions or code in a computer-readablemedium. The computer-readable medium includes a computer storage mediumand a communications medium, and the communications medium includes anymedium that enables a computer program to be transmitted from one placeto another. The storage medium may be any available medium accessible toa computer. This is used as an example but is not limited to: Thecomputer-readable medium may include a RAM, a ROM, an electricallyerasable programmable read-only memory (EEPROM), a compact discread-only memory (CD-ROM) or another compact disc storage, a magneticdisk storage medium or another magnetic storage device, or any othermedium that can be configured to carry or store desired program code ina form of an instruction or a data structure and that can be accessed bya computer. In addition, any connection may be appropriately defined asthe computer-readable medium. For example, if software is transmittedfrom a website, a server or another remote source by using a coaxialcable, an optical fiber cable, a twisted pair, a digital subscriber line(DSL) or a radio technology such as an infrared ray, radio andmicrowave, the coaxial cable, the optical fiber cable, the twisted pair,the DSL or the radio technology such as the infrared ray, the radio andthe microwave are included in fixation of a medium to which they belong.A disk and disc used by the embodiments of this application include acompact disc (CD), a laser disc, an optical disc, a digital video disc(DVD), a floppy disk and a Blu-ray disc, the disk generally copies databy a magnetic means, and the disc copies data optically by a lasermeans. The foregoing combination should also be included in theprotection scope of the computer-readable medium.

In summary, what is described above is merely embodiments of thisapplication, but is not intended to limit the protection scope of thisapplication. Any modification, equivalent replacement, or improvementmade according to the disclosure of this application shall fall withinthe protection scope of this application.

The invention claimed is:
 1. A method, comprising: receiving, by aterminal device, a first operation; starting, by the terminal device, acamera in response to the first operation; displaying, by the terminaldevice, a first preview screen comprising a first preview image, whereinthe first preview image is captured by the camera and comprises a firstphotographed object; displaying, by the terminal device, a firstidentifier of first music on the first preview screen, wherein the firstidentifier is text or an icon, and the first identifier of the firstmusic is determined by matching at least one first keyword correspondingto the first photographed object with at least one second keywordcorresponding to the first music; and obtaining, by the terminal device,a first multimedia file in response to an operation that triggers afirst control, wherein the first multimedia file is obtained by theterminal device by synthesizing the first music and the first previewimage.
 2. The method according to claim 1, further comprising:receiving, by the terminal device, a second operation; in response tothe second operation, displaying, by the terminal device, a secondpreview screen comprising a second preview image, wherein the secondpreview image is different from the first preview image, and the secondpreview image comprises a second photographed object; and displaying, bythe terminal device, a second identifier of second music on the secondpreview screen, wherein the second music is different from the firstmusic, the second music is related to the second photographed object inthe second preview image, and the second identifier is text or an icon.3. The method according to claim 2, wherein the second preview screencomprises a second control, and the method further comprises: obtaining,by the terminal device, a second multimedia file in response to anoperation used to trigger the first control, wherein the secondmultimedia file is obtained by the terminal device by synthesizing thesecond music and the second preview image.
 4. The method according toclaim 1, further comprising: playing, by the terminal device, the firstmusic in response to an operation of triggering the first identifier. 5.The method according to claim 1, wherein a music control is displayed inthe first preview image, the music control is configured to triggerdisplaying a type of music, and the method further comprises:displaying, by the terminal device, a first list in response to a user'soperation of triggering the music control, wherein the first listcomprises at least one type of music; and displaying, by the terminaldevice, the first identifier of the first music in response to a user'soperation of selecting a first type, wherein a type of the first musicis the first type.
 6. The method according to claim 1, wherein the firstmusic is stored on a server and is sent to the terminal device by theserver.
 7. The method according to claim 6, further comprising: sending,by the terminal device, the first preview image to the server; andreceiving, by the terminal device, information related to the firstmusic from the server.
 8. The method according to claim 6, furthercomprising: recognizing, by the terminal device, the first photographedobject; sending, by the terminal device, the at least one first keywordrelated to the first photographed object to the server; and receiving,by the terminal device, information related to the first music from theserver.
 9. The method according to claim 1, wherein the first music is amusic segment.
 10. The method according to claim 1, wherein the icon isa musical note.
 11. The method according to claim 1, wherein the firstphotographed object comprises one of an animal, food, a flower, a greenplant, a mountain, a river, a stage, a beach, a waterfall, a nightscene, a blue sky, or a snow scene.
 12. A terminal device, comprising amemory and a processor, wherein the memory is configured to store acomputer program, and the processor is configured to execute thecomputer program to perform the following: receive a first operation;start a camera in response to the first operation; display a firstpreview screen comprising a first preview image, wherein the firstpreview image is captured by the camera and comprises a firstphotographed object; display a first identifier of first music on thefirst preview screen, wherein the first identifier is text or an icon,and the first identifier of the first music is determined by matching atleast one first keyword corresponding to the first photographed objectwith at least one second keyword corresponding to the first music; andobtain a first multimedia file in response to an operation that triggersa first control, wherein the first multimedia file is obtained by theterminal device by synthesizing the first music and the first previewimage.
 13. The terminal device according to claim 12, wherein theprocessor is configured to further execute the computer program toperform the following: play the first music in response to an operationof triggering the first identifier.
 14. The terminal device according toclaim 12, wherein a music control is displayed in the first previewimage, the music control is configured to trigger displaying a type ofmusic and the processor is configured to further execute the computerprogram to perform the following: display a first list in response to auser's operation of triggering the music control, wherein the first listcomprises at least one type of music; and display the first identifierof the first music in response to a user's operation of selecting afirst type, wherein a type of the first music is the first type.
 15. Theterminal device according to claim 12, wherein the first music is storedon a server and is sent to the terminal device by the server.
 16. Theterminal device according to claim 12, wherein the first music is amusic segment.
 17. A non-transitory computer-readable storage medium,wherein the computer-readable storage medium stores a computer program,and when the computer program runs on a terminal device, the terminaldevice is enabled to perform the following: receive a first operation;start a camera in response to the first operation; display a firstpreview screen comprising a first preview image, wherein the firstpreview image is captured by the camera and comprises a firstphotographed object; display a first identifier of first music on thefirst preview screen, wherein the first identifier is text or an icon,and the first identifier of the first music is determined by matching atleast one first keyword corresponding to the first photographed objectwith at least one second keyword corresponding to the first music; andobtain a first multimedia file in response to an operation that triggersa first control, wherein the first multimedia file is obtained by theterminal device by synthesizing the first music and the first previewimage.